#include "wrn1c1.h"
#define true 1
#define false 0
typedef unsigned char bool;

BLINK_tenFreq WRN_u8CheckLedESP_LED21(void)
{

    uint8 epbErrorSts = SYN__u8ESPFailSts(); // 
    uint8 kl15Status = 1; // 

    static uint8 lostSignalCnt = 0;
    const uint8 TIMEOUT_CYCLE = 10;
    static BLINK_tenFreq lastLedState = WRN__nenOff;
    bool epbTimeout = 0; // 

    // 2. 
    if (epbTimeout) {
        if (lostSignalCnt < TIMEOUT_CYCLE) lostSignalCnt++;
    } else {
        lostSignalCnt = 0;
    }

    // 3. 
    if (lostSignalCnt > TIMEOUT_CYCLE) {
        if (kl15Status) {
            lastLedState = WRN__nenOn; // 
        } else {
            lastLedState = WRN__nenOff; // 
        }
        return lastLedState;
    }

    // 4. 
    if (epbErrorSts == 2) {
        lastLedState = WRN__nenOn; // 
    } else if (epbErrorSts == 3) {
        lastLedState = WRN__nen1Hz; // 
    } else {
        lastLedState = WRN__nenOff; // 
    }
    return lastLedState;
}
